package net.oschina.app.bean;

import android.text.Html;
import android.text.Spanned;
import android.view.View;
import android.widget.TextView;

import com.thoughtworks.xstream.annotations.XStreamAlias;

import net.oschina.app.R;
import net.oschina.app.adapter.DateSortedAdapter;
import net.oschina.app.emoji.InputHelper;
import net.oschina.app.util.StringUtils;
import net.oschina.app.widget.AvatarView;
import net.oschina.app.widget.MyLinkMovementMethod;
import net.oschina.app.widget.MyURLSpan;
import net.oschina.app.widget.TweetTextView;

import java.util.Date;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * Created by yihao on 9/16/15.
 */
@SuppressWarnings("serial")
@XStreamAlias("message")
public class ChatMessage extends Entity implements DateSortedAdapter.DateItem{

    public final static int CLIENT_MOBILE = 2;
    public final static int CLIENT_ANDROID = 3;
    public final static int CLIENT_IPHONE = 4;
    public final static int CLIENT_WINDOWS_PHONE = 5;

    @XStreamAlias("id")
    private int id;

    @XStreamAlias("portrait")
    private String portrait;

    @XStreamAlias("author")
    private String author;

    @XStreamAlias("authorid")
    private int authorid;

//    @XStreamAlias("friendid")
//    private int friendId;
//
//    @XStreamAlias("friendname")
//    private String friendName;
//
//    @XStreamAlias("sender")
//    private String sender;
//
//    @XStreamAlias("senderid")
//    private int senderId;

    @XStreamAlias("content")
    private String content;


    @XStreamAlias("btype")
    private int btype;


    @XStreamAlias("fileName")
    private String fileName;

//    @XStreamAlias("messageCount")
//    private int messageCount;
//
    @XStreamAlias("pubDate")
    private String pubDate;
//
//    @XStreamAlias("appClient")
//    private int appClient;

    public String getPortrait() {
        return portrait;
    }

    public void setPortrait(String portrait) {
        this.portrait = portrait;
    }

//    public int getFriendId() {
//        return friendId;
//    }
//
//    public void setFriendId(int friendId) {
//        this.friendId = friendId;
//    }
//
//    public String getFriendName() {
//        return friendName;
//    }
//
//    public void setFriendName(String friendName) {
//        this.friendName = friendName;
//    }
//
//    public String getSender() {
//        return sender;
//    }
//
//    public void setSender(String sender) {
//        this.sender = sender;
//    }
//
//    public int getSenderId() {
//        return senderId;
//    }
//
//    public void setSenderId(int senderId) {
//        this.senderId = senderId;
//    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

//    public int getMessageCount() {
//        return messageCount;
//    }
//
//    public void setMessageCount(int messageCount) {
//        this.messageCount = messageCount;
//    }

    public String getPubDate() {
        return pubDate;
    }

    public void setPubDate(String pubDate) {
        this.pubDate = pubDate;
    }

//    public int getAppClient() {
//        return appClient;
//    }
//
//    public void setAppClient(int appClient) {
//        this.appClient = appClient;
//    }

    @Override
    public int getId() {
        return id;
    }

    @Override
    public void setId(int id) {
        this.id = id;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public int getBtype() {
        return btype;
    }

    public void setBtype(int btype) {
        this.btype = btype;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public int getAuthorId() {
        return authorid;
    }

    public void setAuthorId(int authorid) {
        this.authorid = authorid;
    }

    @Override
    public Date getDate() {
        return StringUtils.toDate(pubDate);
    }


}
